//package com.tduck.cloud.api.web.controller.form;
//
//import cn.hutool.core.util.StrUtil;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.tduck.cloud.common.util.Result;
//import com.tduck.cloud.form.service.UserFormItemService;
//import com.tduck.cloud.form.service.UserFormService;
//import com.tduck.cloud.common.util.SecurityUtils;
//import lombok.RequiredArgsConstructor;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * 表单接口
// */
//@RestController
//@RequiredArgsConstructor
//@RequestMapping("/form/")
//public class FormController {
//    private final UserFormService userFormService;
//    private final UserFormItemService userFormItemService;
//
//    /**
//     * 获取表单列表
//     *
//     * @return
//     */
//    @GetMapping("/list")
//    public Result getFormList() {
//        return Result.success(userFormService.list(Wrappers.<UserFormEntity>lambdaQuery()
//                .eq(UserFormEntity::getUserId, SecurityUtils.getUserId())
//                .ne(UserFormEntity::getType, 3)));
//    }
//
//    /**
//     * 获取表单列表
//     *
//     * @return
//     */
//    @GetMapping("/page")
//    public Result getFormPage(Page page, String name, String formKey) {
//        Page paged = userFormService.page(page, Wrappers.<UserFormEntity>lambdaQuery()
//                .eq(UserFormEntity::getUserId, SecurityUtils.getUserId())
//                .eq(StrUtil.isNotBlank(formKey), UserFormEntity::getFormKey, formKey)
//                .ne(UserFormEntity::getType, 3)
//                .like(StrUtil.isNotBlank(name), UserFormEntity::getTextName, name));
//        return Result.success(paged);
//    }
//
//    /**
//     * 获取表单项列表
//     *
//     * @return
//     */
//    @GetMapping("/item/list")
//    public Result getFormItemList(@RequestParam("formKey") String formKey) {
//        return Result.success(userFormItemService.list(Wrappers.<UserFormItemEntity>lambdaQuery().eq(UserFormItemEntity::getFormKey, formKey)));
//    }
//
//    /**
//     * 获取表单字段 包括系统默认字段
//     */
//    @GetMapping("/fields")
//    public Result queryUserFormFields(@RequestParam("formKey") String formKey) {
//        return Result.success(userFormItemService.listAllFormFields(formKey));
//    }
//
//
//}
